package com.skyline.energy.provider.spring;

import java.sql.ResultSet;
import java.sql.SQLException;

import com.skyline.energy.dataaccess.jdbc.RowMapper;

/**
 * 
 * @author wuqh
 *
 * @param <T>
 */
public class SpringRowMapperAdapter<T> implements org.springframework.jdbc.core.RowMapper<T> {
	private final RowMapper<T> rowMapper;

	/**
	 * 
	 * @param rowMapper
	 */
	public SpringRowMapperAdapter(RowMapper<T> rowMapper) {
		this.rowMapper = rowMapper;
	}

	@Override
	public T mapRow(ResultSet rs, int rowNum) throws SQLException {
		return rowMapper.mapRow(rs, rowNum);
	}

}
